<template>
  <div class="note-detail-wrap">
     
    <el-page-header :icon="null" @back="back">
      <template #content>
        <span class="title"> {{ title }} </span>
      </template>
    </el-page-header>

     <div class="content-wrap">
       <div v-html="content"></div>
     </div>
  </div>
</template>

<script>
import { onMounted, ref } from "vue";
import { useRoute,useRouter } from "vue-router";
import request from "utils/request";

export default {
  name: "JddChromePluginsNoteDetail",
  setup() {
    const route = useRoute();
    const router = useRouter();
    const { id } = route.query;

    const title = ref("");
    const content = ref("");

    onMounted(async () => {
      if (id) {
        let ret = await request.post("/findNote", { id });
        if (ret.code == 200) {
          title.value = ret.data.title;
          content.value = ret.data.content;
        }
      }
    });

    const back=()=>{
        router.back();
    }

    return {
        title,
        content,
        back
    }
  },
};
</script>

<style lang="scss" scoped>
.note-detail-wrap{
    width: 550px;
    min-height: 400px;
    padding: 15px 20px;
    .content-wrap{
        width: 100%;
        padding: 20px 0px;
        height: 400px;
        overflow-y: auto;
    }
}
</style>